import request from "@/utils/request";

// 新增短链分组
export function addShortGroup(data) {
  return request({
    url: "/short/group",
    method: "post",
    data: data,
  });
}

//  获取短链分组分页
export function getShortGroupPage(data) {
  return request({
    url: "/short/group/page",
    method: "get",
    params: data,
  });
}

//  获取短链分组集合
export function getShortGroupList(data) {
  return request({
    url: "/short/group/list",
    method: "get",
    params: data,
  });
}

//  修改短链分组
export function updateShortGroupPage(data) {
  return request({
    url: "/short/group",
    method: "put",
    data: data,
  });
}

//  删除短链分组
export function deleteShortGroupPage(id) {
  return request({
    url: `/short/group/${id}`,
    method: "delete",
  });
}

//  获取短链分页
export function  getShortLinkPage(data) {
  return request({
    url: `/short/link/page`,
    method: "get",
    params: data,
  });
}

//  新增短链
export function  addShortLink(data) {
  return request({
    url: `/short/link`,
    method: "post",
    data: data,
  });
}

//  修改短链
export function  updateShortLink(data) {
  return request({
    url: `/short/link`,
    method: "put",
    data: data,
  });
}


//  删除短链
export function  delteShortLink(id) {
  return request({
    url: `/short/link/${id}`,
    method: "delete", 
  });
}




// 文章分类列表
export function getArticleCateList(data) {
  return request({
    url: "/article/category",
    method: "get",
    params: data,
  });
}

// 文章分类详情
export function getArticleCateDetail(id) {
  return request({
    url: "/article/category/" + id,
    method: "get",
  });
}

// 文章分类新增
export function addArticleCate(data) {
  return request({
    url: "/article/category",
    method: "post",
    data: data,
  });
}

// 文章分类编辑
export function editArticleCate(data) {
  return request({
    url: "/article/category",
    method: "put",
    data: data,
  });
}

// 文章分类删除
export function deleteArticleCate(id) {
  return request({
    url: "/article/category/" + id,
    method: "delete",
  });
}

export function getArticleListTree() {
  return request({
    url: "/article/category/list/tree",
    method: "get",
  });
}
export function getArticleList(data) {
  return request({
    url: "/article",
    method: "get",
    params: data,
  });
}
export function addArticle(data) {
  return request({
    url: "/article",
    method: "post",
    data: data,
  });
}

export function editArticle(data) {
  return request({
    url: "/article",
    method: "put",
    data: data,
  });
}

export function getArticleInfo(id) {
  return request({
    url: "/article/" + id,
    method: "get",
  });
}

export function deleteArticle(id) {
  return request({
    url: "/article/" + id,
    method: "delete",
  });
}

export function deleteArticleBatch(ids) {
  return request({
    url: `/article/batchDelete/${ids}`,
    method: "delete",
  });
}

export function editArticleStatus(data) {
  return request({
    url: "/article/update/publishStatus",
    method: "post",
    data: data,
  });
}

// 获取关联账号列表
export function getLinkAccountlist() {
  return request({
    url: "/official/account/list",
    method: "get",
  });
}
//获取热门话题列表
export function getHotTopicList() {
  return request({
    url: "/hotTopic/list",
    method: "get",
  });
}
//文章置顶/取消置顶

export function editArticleTop(id) {
  return request({
    url: `article/cancelTop/${id}`,
    method: "put",
  });
}

//发帖审核
export function editArticleAudit(data) {
  return request({
    url: `/article/verify`,
    method: "put",
    data: data,
  });
}

//获取评论列表
export function getCommentList(data) {
  return request({
    url: `/article/comment`,
    method: "get",
    params: data,
  });
}

export function deleteComment(id) {
  return request({
    url: `/article/comment/batchDelete/${id}`,
    method: "delete",
  });
}

//批量发布文章
export function batchPublishArticle(data) {
  return request({
    url: `/article/update/publishStatus`,
    method: "post",
    data: data,
  });
}

//查看回复列表
export function getReplyList(params) {
  return request({
    url: `/article/replay/`,
    method: "get",
    params,
  });
}
//批量删除回复
export function batchDeleteReply(ids) {
  return request({
    url: `/article/replay/batchDelete/${ids}`,
    method: "delete",
  });
}

//获取官方账号
export function getOfficialAccountList(params) {
  return request({
    url: `/official/account`,
    method: "get",
    params,
  });
}
//新增官方账号
export function addOfficialAccount(data) {
  return request({
    url: `/official/account`,
    method: "post",
    data,
  });
}

//编辑官方账号
export function editOfficialAccount(data) {
  return request({
    url: `/official/account`,
    method: "put",
    data,
  });
}
//删除官方账号
export function deleteOfficialAccount(id) {
  return request({
    url: `/official/account/${id}`,
    method: "delete",
  });
}
export function getVirtualAccountList(params) {
  return request({
    url: `/virtual/account`,
    method: "get",
    params,
  });
}
//新增水军账号
export function addVirtualAccount(data) {
  return request({
    url: `/virtual/account`,
    method: "post",
    data,
  });
}

//编辑水军账号
export function editVirtualAccount(data) {
  return request({
    url: `/virtual/account`,
    method: "put",
    data,
  });
}
//删除水军账号
export function deleteVirtualAccount(id) {
  return request({
    url: `/virtual/account/${id}`,
    method: "delete",
  });
}

//获取banner 列表
export function getBannerList(params) {
  return request({
    url: `/advertise/page`,
    method: "get",
    params,
  });
}
//新增banner
export function addBanner(data) {
  return request({
    url: `/advertise`,
    method: "post",
    data,
  });
}

//编辑banner
export function editBanner(data) {
  return request({
    url: `/advertise`,
    method: "put",
    data,
  });
}
//删除banner
export function deleteBanner(ids) {
  return request({
    url: `/advertise/${ids}`,
    method: "delete",
  });
}
//获取详情
export function getBannerDetail(id) {
  return request({
    url: `/advertise/${id}`,
    method: "get",
  });
}

//获取文章评论及回复列表

export function getArticleCommentList(params) {
  return request({
    url: `/article/getCommentReplayList`,
    method: "get",
    params,
  });
}

//评论回复审核
export function editCommentAudit(data) {
  return request({
    url: `/article/comment/verify`,
    method: "put",
    data: data,
  });
}

// 删除评论以及回复

export function deleteCommentAndReply(data) {
  return request({
    url: `/article/batchDeleteCommentReplay`,
    method: "delete",
    data,
  });
}

//获取第三方素材
export function getThirdMaterialList(data) {
  return request({
    url: `/material/page`,
    method: "get",
    params: data,
  });
}
//获取第三方素材详情
export function getThirdMaterialDetail(id) {
  return request({
    url: `/material/${id}`,
    method: "get",
  });
}

//删除第三方素材
export function deleteThirdMaterial(ids) {
  return request({
    url: `/material/${ids}`,
    method: "delete",
  });
}
export function verify(data) {
  return request({
    url: "/article/comment/verify",
    method: "put",
    data: data,
  });
}

//新增海报素材分类表
export function cate(data) {
  return request({
    url: `/poster/cate`,
    method: "post",
    data,
  });
}
//获取海报素材分类表列表
export function catelist(params) {
  return request({
    url: `/poster/cate/list`,
    method: "get",
    params,
  });
}
// 修改海报素材分类表
export function haibaocate(data) {
  return request({
    url: `/poster/cate`,
    method: "put",
    data: data,
  });
}
// 修改海报素材上下架分类表
export function cateenableStatus(data) {
  return request({
    url: `/poster/cate/enableStatus`,
    method: "put",
    data: data,
  });
}
//根据主键id删除海报素材分类表
export function deletecate(ids) {
  return request({
    url: `/poster/cate/${ids}`,
    method: "delete",
  });
}

//新增海报素材表
export function haibao(data) {
  return request({
    url: `/poster`,
    method: "post",
    data,
  });
}
//获取海报素材表分页列表
export function haibaopage(params) {
  return request({
    url: `/poster/page`,
    method: "get",
    params,
  });
}
// 修改海报素材上下架分类表
export function uphaibao(data) {
  return request({
    url: `/poster`,
    method: "put",
    data: data,
  });
}
//根据主键id删除海报素材表
export function deletecates(ids) {
  return request({
    url: `/poster/deleteBatch/${ids}`,
    method: "delete",
  });
}
// 修改海报素材上下架表
export function cateenableStatusStatus(data) {
  return request({
    url: `/poster/enableStatus`,
    method: "put",
    data: data,
  });
}
//生成二维码
export function haibaodownload(params) {
  return request({
    url: `/poster/download`,
    method: "get",
    params,
  });
}
export function downloadhaibao(id) {
  return request({
    url: `/poster/download/${id}`,
    method: "get",
  });
}

//新增短视频
export function addVideo(data) {
  return request({
    url: `/article/createVideo`,
    method: "post",
    data: data,
  });
}
//获取标签管理列表
export function getTagList(params) {
  return request({
    url: `/article/tag/page`,
    method: "get",
    params,
  });
}
//新增标签
export function addTag(data) {
  return request({
    url: `/article/tag`,
    method: "post",
    data: data,
  });
}
//修改标签
export function editTag(data) {
  return request({
    url: `/article/tag`,
    method: "put",
    data: data,
  });
}
//删除标签
export function deleteTag(ids) {
  return request({
    url: `/article/tag/${ids}`,
    method: "delete",
  });
}
//获取标签列表 不分页
export function getTagListNoPage() {
  return request({
    url: `/article/tag/list`,
    method: "get",
  });
}

//获取上传视屏凭证

export function getUploadVideoToken() {
  return request({
    url: `/volc/vod/sts2Token`,
    method: "get",
  });
}

//获取播放凭证

export function getPlayAuth(params) {
  return request({
    url: `/volc/vod/playAuthToken`,
    method: "get",
    params
  });
}